import Vue from 'vue'
import Vuex from 'vuex'
import actions from './actions';
// import getters from './getters';
import mutations from './mutations';

import home from './modules/home'
import category from './modules/category'
import proDetail from './modules/product-detail'
import search from './modules/search'
import proList from './modules/product-list'
import cart from './modules/cart'
Vue.use(Vuex)

const debug = process.env.NODE_ENV !== 'production' //避免引入热重载和开发的相关代码

const state = {
   accessToken:'',
   expireTime:''
}

// const actions = {
//   // ..
// }

// const mutations = {
//   // ..
// }

const store = new Vuex.Store({
  state,
  // getters,
  actions,
  modules: {
    home,
    category,
    proDetail,
    search,
    proList,
    cart
  },
  mutations,
  strict: debug
})

export default store
